package com.qf.spbtrabbitmq.Receiver;

import com.qf.spbtrabbitmq.config.RabbitConfig;
import com.qf.spbtrabbitmq.pojo.User;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class TopicReceiver {

    //queues是指要监听的队列的名字
    @RabbitListener(queues = RabbitConfig.TOPIC_QUEUE1)
    public void receiveTopic1(User user){
        System.out.println("[receiveTopic1] receive message"+user.toString());
    }

    @RabbitListener(queues = RabbitConfig.TOPIC_QUEUE2)
    public void receiveTopic2(User user){
        System.out.println("[receiveTopic2] receive message"+user.toString());
    }

}
